package org.hitchhike.core.service;

import org.hitchhike.common.service.BaseService;
import org.hitchhike.core.domain.Comment;
import org.hitchhike.core.repository.CommentRepository;
import org.hitchhike.core.utils.PageableUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
public class CommentService extends BaseService<Comment, Long> {

  @Autowired
  private CommentRepository getCommentRepository() {
    return (CommentRepository) baseRepository;
  }

  public Page<Comment> findPageComment(Integer page) {
    return getCommentRepository().findAll(PageableUtil.getPageable(page, 10));
  }

}
